<?php
/**
 * class for logging to text files
 *
 * @author raphael seebacher <raphasee@ee.ethz.ch>
 * @version 0.01
 */
class log_text extends log {
    protected $fh = NULL;

    /**
     * default constructor
     *
     * @param string $logfile filename for the file the log will be
     * written to. ensure that the file is writeable.
     */
    public function __construct($logfile) {
        $this->fh = fopen($logfile, 'a');
    }

    public function __destruct() {
        fclose($this->fh);
    }

    protected function write($str) {
        fwrite($this->fh, $str);
    }
}
?>